package cn.tedu.egmvc1.pojo;

import cn.tedu.egmvc1.ato.Update;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AddUser {
@RequestMapping(value = "/v1/users/insert")
@ResponseBody
    public String insert(String username,String password,String nickname){
    System.out.println(username+password+nickname);
    return "添加成功";
    }
    @RequestMapping(value = "/v1/users/userList")
    @ResponseBody
    public String userList(){
    return   "查询用户列表成功";
    }
    @RequestMapping(value = "/v1/users/delete")
    @ResponseBody
    public String userDelete(Integer id){
    return  "删除成功，用户id为："+id;
    }

    @RequestMapping(value = "/v1/users/update")
    @ResponseBody
    public String userUpdate(Update update){
        System.out.println(update.getId()+update.getUsername()+update.getPassword()+update.getNickname());
        return "更新成功";
    }
}
